package db

import "core/rds"

const (
	versionDevKey   = "client:ver:dev"
	versionAuditKey = "client:ver:audit"
)

func SaveVersion(devVersion, auditVersion string) (err error) {
	err = rds.GetDefaultClient().Set(versionDevKey, devVersion, 0).Err()
	if err != nil {
		return
	}
	err = rds.GetDefaultClient().Set(versionAuditKey, auditVersion, 0).Err()
	if err != nil {
		return
	}
	return
}

func LoadVersion() (devVersion, auditVersion string) {
	return rds.GetDefaultClient().Get(versionDevKey).Val(), rds.GetDefaultClient().Get(versionAuditKey).Val()
}
